/*
 * envelope.h
 *
 * 		Amplitude envelope implementation.
 *
 * 		Amplitude range:
 * 		Attack section: 	0.0 - 1.0
 * 		Decay section:		1.0 - 0.7
 * 		Sustain section:	0.7
 * 		Release section:	0.7 - 0.0
 *
 */

#ifndef ENVELOPE_H_
#define ENVELOPE_H_

#include <defs.h>
#include <voice.h>

// envelope section
#define ATTACK 	0
#define DECAY 	1
#define SUSTAIN 2
#define RELEASE 3

void envelope_init(float attackTime, float decayTime, float releaseTime);
int32_t envelope_update(int32_t sampleIn);
void envelope_release();


#endif /* ENVELOPE_H_ */
